package cn.edu.scau.cmi.ningkehua.singleton;

public class Marshal {
	private static Marshal instance;
	private String name;
	private Marshal(String name) {
		this.name=name;
	}
	public static Marshal getInstance(String name) {
		if(instance==null && (!name.equals(null)))
		{
			instance=new Marshal(name);
		}
		return instance;
	}

}

//public class Marshal {
//	private static Marshal instance[] = new Marshal[10];
//	private String name;
//
//	private Marshal(String name) {
//		this.name = name;
//	}
//
//	public static Marshal[] getInstance(String name) {
//		int count1 = 0;
//		int count2 = 0;
//		for (count1 = 0; count1 < 10; count1++) {
//			if (instance[count2] == null && (!name.equals(null)) && count2 < 10) {
//				instance[count2] = new Marshal(name);
//				break;
//			} else {
//				count2++;
//			}
//		}
//		return instance;
//	}
//}

